<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org" xmlns:cb="http://www.ossbar.com/">
<head th:include="layout/head" />
<div th:include="layout/foot"></div>
<script type="text/javascript" th:inline="javascript">
	cb.loadmodules([ "validate", "ajax", "lay" ]);
</script>
<body>
<form class="form-horizontal" id="tmailAttachForm" th:action="@{/mail/tmailattach/saveorupdate}" th:object="${tmailAttach}">
	<input type="hidden" id="maId" name="maId" th:field="*{maId}" />
		<input type="hidden" name="tokenForm"
			th:value="${#session.getAttribute('tokenForm')}" />
		<table class="table table-bordered FormView cb-table-fun">
				<tr>
				<td class="cb-label">邮件id</td>
				<td class="cb-value"><input type="text"
					class="form-control cb-form-control validate[required,maxSize[32]]" data-msg=""
					id="mid" name="mid" th:field="*{mid}" placeholder="邮件id" /></td>
				<td class="cb-label">文件路径</td>
				<td class="cb-value"><input type="text"
					class="form-control cb-form-control validate[required,maxSize[500]]" data-msg=""
					id="maUrl" name="maUrl" th:field="*{maUrl}" placeholder="文件路径" /></td>
				</tr>
				<tr>
				<td class="cb-label">文件名称</td>
				<td class="cb-value"><input type="text"
					class="form-control cb-form-control validate[required,maxSize[500]]" data-msg=""
					id="maName" name="maName" th:field="*{maName}" placeholder="文件名称" /></td>
				<td class="cb-label">文件别名</td>
				<td class="cb-value"><input type="text"
					class="form-control cb-form-control validate[required,maxSize[500]]" data-msg=""
					id="maSecondName" name="maSecondName" th:field="*{maSecondName}" placeholder="文件别名" /></td>
				</tr>
				<tr>
				<td class="cb-label">文件类型</td>
				<td class="cb-value"><input type="text"
					class="form-control cb-form-control validate[required,maxSize[10]]" data-msg=""
					id="maType" name="maType" th:field="*{maType}" placeholder="文件类型" /></td>
				<td class="cb-label">文件大小</td>
				<td class="cb-value"><input type="text"
					class="form-control cb-form-control validate[required,maxSize[10]]" data-msg=""
					id="maSize" name="maSize" th:field="*{maSize}" placeholder="文件大小" /></td>
				</tr>
				<tr>
				<td class="cb-label">文件后缀</td>
				<td class="cb-value"><input type="text"
					class="form-control cb-form-control validate[required,maxSize[20]]" data-msg=""
					id="maSuffix" name="maSuffix" th:field="*{maSuffix}" placeholder="文件后缀" /></td>
				<td class="cb-label">文件链接</td>
				<td class="cb-value"><input type="text"
					class="form-control cb-form-control validate[required,maxSize[1000]]" data-msg=""
					id="maLj" name="maLj" th:field="*{maLj}" placeholder="文件链接" /></td>
				</tr>
				<tr>
				<td class="cb-label">文件编号</td>
				<td class="cb-value"><input type="text"
					class="form-control cb-form-control validate[required,maxSize[100]]" data-msg=""
					id="maNo" name="maNo" th:field="*{maNo}" placeholder="文件编号" /></td>
				<td class="cb-label">文件状态</td>
				<td class="cb-value"><input type="text"
					class="form-control cb-form-control validate[required,maxSize[5]]" data-msg=""
					id="maState" name="maState" th:field="*{maState}" placeholder="文件状态" /></td>
				</tr>
				<tr>
				<td class="cb-label">文件排序号</td>
				<td class="cb-value"><input type="text"
					class="form-control cb-form-control validate[required,maxSize[10]]" data-msg=""
					id="maSortNo" name="maSortNo" th:field="*{maSortNo}" placeholder="文件排序号" /></td>
				</tr>
		</table>
	</form>
</body>
<script type="text/javascript" th:inline="javascript">
	//保存
	top.cb.oper.save = function() {// save_click()

		cb.submit("#tmailAttachForm", "mail/tmailattach/saveorupdate", function(data) {
			if(data.email){
				cb.alert("存在其他业务员的客户邮箱["+data.email+"]，请重新检查！");
				return false;
			}else{
				cb.alert("保存成功", function() {
					cb.winclose()
				});
			}
		}, {
			contentType : "application/x-www-form-urlencoded"
		})
	}
	//保存并继续
	top.cb.oper.saveAndAdd = function(){
		cb.submit("#tmailAttachForm","mail/tmailattach/saveorupdate",function(){
			cb.alert("保存成功",function(){location.reload(true); });// 提交后重置表单
			
		})
	}
</script>
</html>